package org.example.controller;

import org.example.annotations.ProcessInfo;
import org.example.entity.User;
import org.example.service.IUserService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("*")
@CrossOrigin("*")
@RestController
public class UserController {

    private IUserService iUserService;

    public UserController(IUserService iUserService) {
        this.iUserService = iUserService;
    }

    @RequestMapping("/getById/{id}")
    @ProcessInfo("根据id查询用户")
    public User getById(@PathVariable("id")Integer id){
        return iUserService.getById(id);
    }
}
